package com.molin.StreamTest;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

public class Demo7 {
    public static void main(String[] args) {
        ArrayList<Integer> list=new ArrayList<>(List.of(1,2,3,4,5,6,7,8,9,10,10));
        List<Integer> list1= list.stream().filter(s->s%2==0).collect(Collectors.toList());
        System.out.println(list1);
        Set<Integer> set1=list.stream().filter(s->s%2==0).collect(Collectors.toSet());
        System.out.println(set1);
    }
}
